//
//  UIView+BSGExtension.m
//  百思不得姐
//
//  Created by lc on 2017/3/10.
//  Copyright © 2017年 lc. All rights reserved.
//

#import "UIView+BSGExtension.h"

@implementation UIView (BSGExtension)

-(CGFloat)bsg_width{
    
    return  self.frame.size.width;
}

-(CGFloat)bsg_height{
    
    return self.frame.size.height;
}
-(void)setBsg_width:(CGFloat)bsg_width{
    CGRect frame =self.frame;
    frame.size.width=bsg_width;
    self.frame=frame;
}
-(void)setBsg_height:(CGFloat)bsg_height{
    CGRect frame =self.frame;
    frame.size.height=bsg_height;
    self.frame=frame;
}

-(CGFloat)bsg_x{
    
    return self.frame.origin.x;
}
-(CGFloat)bsg_y{
    
    return self.frame.origin.y;
}
-(void)setBsg_x:(CGFloat)bsg_x{
    CGRect frame =self.frame;
    frame.origin.x=bsg_x;
    self.frame=frame;
}
-(void)setBsg_y:(CGFloat)bsg_y{
    CGRect frame =self.frame;
    frame.origin.y =bsg_y;
    self.frame=frame;
}

-(CGFloat)bsg_centerX{
    return  self.center.x;
}
-(CGFloat)bsg_centerY{
    return self.center.y;
}

-(void)setBsg_centerX:(CGFloat)bsg_centerX{
    CGPoint center = self.center;
    center.x=bsg_centerX;
    self.center=center;
}

-(void)setBsg_centerY:(CGFloat)bsg_centerY{
    CGPoint center = self.center;
    center.y=bsg_centerY;
    self.center=center;
}

-(CGFloat)bsg_right{
    return  CGRectGetMaxX(self.frame);
}

-(CGFloat)bsg_bottom{
    return  CGRectGetMaxY(self.frame);
}
-(void)setBsg_right:(CGFloat)bsg_right{
    self.bsg_x =bsg_right-self.bsg_width;
}

-(void)setBsg_bottom:(CGFloat)bsg_bottom{
    self.bsg_y=bsg_bottom-self.bsg_height;
    
}
-(CGSize)bsg_size
{
    return self.frame.size;
}
-(void)setBsg_size:(CGSize)bsg_size{
    CGRect frame =self.frame;
    frame.size =bsg_size;
    self.frame=frame;
}
@end
